/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package huffmanlab;

/**
 *
 * @author Xearus
 */
public class HuffmanCharacter implements Comparable<HuffmanCharacter> {
    public final long Weight;
    public final int Value;
    public final Side[] CompressedValue;
    
    public HuffmanCharacter(int value, long weight, Side[] compressedValue) {
        Value = value;
        Weight = weight;
        CompressedValue = compressedValue;
    }

    @Override
    public int compareTo(HuffmanCharacter o) {
        if(Value == o.Value) {
            if(Weight > o.Weight)
                return 1;
            else if(Weight < o.Weight)
                return -1;
            else
                return 0;
        } else {
            return Value - o.Value;
        }
    }
    
}
